package com.disability_federation.controller;

import com.disability_federation.mapper.MapperCityAmountsWithhold;
import com.disability_federation.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 市级残保金代扣名单操作接口
 */
@RestController
@CrossOrigin
public class ControllerCityAmountsWithhold {

    @Autowired
    private MapperCityAmountsWithhold mapperCityAmountsWithhold;

    /**
     * 查询全部代扣名单
     * 默认时间升序排序
     */
    @RequestMapping("CityAW/query")
    public Result query(){
        return Result.success(mapperCityAmountsWithhold.query());
    }

    /**
     * 查询全部代扣名单
     * 时间降序排序
     */
    @RequestMapping("CityAW/query/time_desc")
    public Result queryDesc(){
        return Result.success(mapperCityAmountsWithhold.queryDesc());
    }

    /**
     * 查询全部代扣名单
     * 姓名升序排序
     */
    @RequestMapping("CityAW/query/name_asc")
    public Result queryNameAsc(){
        return Result.success(mapperCityAmountsWithhold.queryNameAsc());
    }

    /**
     * 查询全部代扣名单
     * 姓名降序排序
     */
    @RequestMapping("CityAW/query/name_desc")
    public Result queryNameDesc(){
        return Result.success(mapperCityAmountsWithhold.queryNameDesc());
    }

    /**
     * 查询全部代扣名单
     * 单位升序排序
     */
    @RequestMapping("CityAW/query/unit_asc")
    public Result queryUnitAsc(){
        return Result.success(mapperCityAmountsWithhold.queryUnitAsc());
    }

    /**
     * 查询全部代扣名单
     * 单位降序排序
     */
    @RequestMapping("CityAW/query/unit_desc")
    public Result queryUnitDesc(){
        return Result.success(mapperCityAmountsWithhold.queryUnitDesc());
    }

    /**
     * 查询全部代扣名单
     * 金额升序排序
     */
    @RequestMapping("CityAW/query/money_asc")
    public Result queryMoneyAsc(){
        return Result.success(mapperCityAmountsWithhold.queryMoneyAsc());
    }

    /**
     * 查询全部代扣名单
     * 金额降序排序
     */
    @RequestMapping("CityAW/query/money_desc")
    public Result queryMoneyDesc(){
        return Result.success(mapperCityAmountsWithhold.queryMoneyDesc());
    }

    /**
     * 条件查询
     * 默认时间升序排序
     */
    @RequestMapping("CityAW/query/condition")
    public Result queryCondition(String name, String unit, Integer money1, Integer money2){
        return Result.success(mapperCityAmountsWithhold.queryCondition(name, unit, money1, money2));
    }

    /**
     * 条件查询
     * 时间降序排序
     */
    @RequestMapping("CityAW/query/condition/time_desc")
    public Result queryConditionDesc(String name, String unit, Integer money1, Integer money2){
        return Result.success(mapperCityAmountsWithhold.queryConditionDesc(name, unit, money1, money2));
    }

    /**
     * 条件查询
     * 金额升序排序
     */
    @RequestMapping("CityAW/query/condition/money_asc")
    public Result queryConditionMoneyAsc(String name, String unit, Integer money1, Integer money2){
        return Result.success(mapperCityAmountsWithhold.queryConditionMoneyAsc(name, unit, money1, money2));
    }

    /**
     * 条件查询
     * 金额降序排序
     */
    @RequestMapping("CityAW/query/condition/money_desc")
    public Result queryConditionMoneyDesc(String name, String unit, Integer money1, Integer money2){
        return Result.success(mapperCityAmountsWithhold.queryConditionMoneyDesc(name, unit, money1, money2));
    }

    /**
     * 条件查询
     * 姓名升序排序
     */
    @RequestMapping("CityAW/query/condition/name_asc")
    public Result queryConditionNameAsc(String name, String unit, Integer money1, Integer money2){
        return Result.success(mapperCityAmountsWithhold.queryConditionNameAsc(name, unit, money1, money2));
    }

    /**
     * 条件查询
     * 姓名降序排序
     */
    @RequestMapping("CityAW/query/condition/name_desc")
    public Result queryConditionNameDesc(String name, String unit, Integer money1, Integer money2){
        return Result.success(mapperCityAmountsWithhold.queryConditionNameDesc(name, unit, money1, money2));
    }

    /**
     * 条件查询
     * 单位升序排序
     */
    @RequestMapping("CityAW/query/condition/unit_asc")
    public Result queryConditionUnitAsc(String name, String unit, Integer money1, Integer money2){
        return Result.success(mapperCityAmountsWithhold.queryConditionUnitAsc(name, unit, money1, money2));
    }

    /**
     * 条件查询
     * 单位降序排序
     */
    @RequestMapping("CityAW/query/condition/unit_desc")
    public Result queryConditionUnitDesc(String name, String unit, Integer money1, Integer money2){
        return Result.success(mapperCityAmountsWithhold.queryConditionUnitDesc(name, unit, money1, money2));
    }
}
